package com.api.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import com.api.dao.UserDao;
import com.api.model.User;

@Transactional
public class UserService {

    @Autowired
    UserDao userDao;

    public User add(User user) {
        return userDao.add(user);
    }

    public boolean delete(Long id) {
        return userDao.delete(id);
    }

    public boolean update(User user) {
        return userDao.update(user);
    }

    @Transactional(readOnly = true)
    public User query(Long id) {
        return userDao.query(id);
    }

}
